{extend name="main/index" /}
{block name="main"}
<div class="main-content">
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="#">Home</a>
            </li>

            <li>
                <a href="#">Tables</a>
            </li>
<<<<<<< HEAD
            <li class="active">技术列表</li>
=======
            <li class="active">工程列表</li>
>>>>>>> a40bd7c37eef93aca4b7ae3126fd10da65b4232b
        </ul><!-- .breadcrumb -->

        <div class="nav-search" id="nav-search">
            <form class="form-search">
                <span class="input-icon">
                    <input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
                    <i class="icon-search nav-search-icon"></i>
                </span>
            </form>
        </div><!-- #nav-search -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="table-responsive">
                            <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>项目名称</th>
<<<<<<< HEAD
                                        <th>施组设计书</th>
                                        <th>编制人</th>
                                        <!-- <th>流程状态</th> -->
                                        <th class="hidden-480">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {volist name="list" id="v"}
                                    <tr>
                                        <td>{$v['id']}</td>
                                        <td>{$v['project_name']}</td>
                                        <td>{$v['design_name']}</td>
                                        <td>{$v['organization_user']}</td>
                                        <!-- <td><button  data-id="{//$v['id']}" class="btn btn-xs btn-primary show-btn" data-toggle="modal"
                                data-target="#myModal" >查看</button>
                                        </td> -->
                                        <!-- <td> -->
                                            <!-- {//$v['status']} -->
                                            <!-- <?php// if( $v['status'] == 1 ): ?> -->
                                                <!-- 审核中 -->
                                            <!-- <?php //elseif($v['satus'] == 2): ?> -->
                                                <!-- 已开工 -->
                                            <!-- <?php// else: ?> -->
                                                <!-- 已完工 -->
                                            <!-- <?php //endif ?> -->
                                        <!-- </td> -->
                                        <td>
                                            <button data-id="{$v['id']}" class="btn btn-xs btn-primary show-btn" data-toggle="modal"
                                data-target="#myModal" >查看详情</button> | 
                                            <a href="{:url('admin/technique/edit', ['id' => $v['id']])}" class="btn btn-xs btn-primary">修改</a> | 
                                            <button data-id="{$v['id']}" class="btn btn-xs btn-danger del-btn" >删除</button> | 
                                            <a href="{:url('admin/technique/export', ['id' => $v['id']])}" class="btn btn-xs btn-info">导出</a>
=======
                                        <th class="hidden-480">工程总价</th>
                                        <th>工程地点</th>
                                        <th>施工内容</th>
                                        <th>开工时间</th>
                                        <th>完工时间</th>
                                        <th>建设单位</th>
                                        <th>施工单位</th>
                                        <th>流程状态</th>
                                        <th class="hidden-480">操作</th>

                                    </tr>
                                </thead>
                                <tbody>
                                    {//volist name="list" id="v"}
                                    <tr>
                                        <td>{//$v['id']}</td>
                                        <td>{//$v['project_name']}</td>
                                        <td>{//$v['project_price']}<span>万元</span></td>
                                        <td>{//$v['project_address']}</td>
                                        
                                        <td>{//$v['start_time']}</td>
                                        <td>{//$v['makespan']}</td>
                                        <td>{//$v['build_unit']}</td>
                                        <td>{//$v['construction_unit']}</td>
                                        <td><button  data-id="{//$v['id']}" class="btn btn-xs btn-primary show-btn" data-toggle="modal"
                                data-target="#myModal" >查看</button>
                                        </td>
                                        <td>
                                            <?php// if( $v['status'] == 1 ): ?>
                                                <!-- 审核中 -->
                                            <?php //elseif($v['satus'] == 2): ?>
                                                <!-- 已开工 -->
                                            <?php// else: ?>
                                                <!-- 已完工 -->
                                            <?php //endif ?>
                                        </td>
                                        <td>
                                            <a href="{//:url('admin/engine/edit', ['id' => $v['id']])}">修改</a> | 
                                            <button data-id="{//$v['id']}" class="btn btn-xs btn-danger del-btn" >删除</button>
>>>>>>> a40bd7c37eef93aca4b7ae3126fd10da65b4232b
                                        </td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">
<<<<<<< HEAD
                    项目名称:<u></u> 
=======
                    项目 <u></u> 的施工信息
>>>>>>> a40bd7c37eef93aca4b7ae3126fd10da65b4232b
                </h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
<<<<<<< HEAD
                        发起人:<p class="content2" style="margin-left: 40px"></p>
                        设计书:<p class="content3" style="margin-left: 40px"></p>
                        文件路径:<p class="content4" style="margin-left: 40px"></p>
                        <!-- <a class="content5" href="">查看文件</a><br> -->
                        状态:<p class="content1" style="margin-left: 40px">
                        </p>
=======
                        <span></span>
                        <hr>
                        <u>详情参见合同书</u>: ---《<b style="font-size:24px;"></b>》---
>>>>>>> a40bd7c37eef93aca4b7ae3126fd10da65b4232b
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>


{/block}


{block name="myjs"}
{js href="/static/admin/assets/js/toastr.min.js"}
<script>
    $(function(){
        $('.show-btn').click(function () {
            var ac_id = $(this).attr('data-id');
            console.log('我要查询: ' + ac_id + '的项目施工内容');
            showAjax(ac_id);
        });

        $('.del-btn').click(function () {
            var ac_id = $(this).attr('data-id');
            console.log('我要删除: ' + ac_id + '的项目');
            if (confirm('你确定要 [ 删 除 ] 吗?')) {
                var obj = $(this).parents('tr');
                // console.log(obj);
                delAjax(ac_id, obj);
            }
        });

    });

    // 查看项目的施工内容
    function showAjax(id) {
        $.ajax({
            type: 'get',
<<<<<<< HEAD
            url: '/Technique/' + id,
=======
            url: '/Engine/' + id,
>>>>>>> a40bd7c37eef93aca4b7ae3126fd10da65b4232b
            dataType: 'json',
            success: function (data) {
                console.log(data);
                if (data.status) {
                    //  modal填充
                    $('.modal-title u').html(data.title);
<<<<<<< HEAD
                    $('.modal-body .content2').html(data.data.organization_user);
                    $('.modal-body .content3').html(data.data.design_name);
                    $('.modal-body .content1').html(data.data.status==1?'完成':'改善');
                    $('.modal-body .content4').html(data.data.organization_design);
                    $('.modal-body .content5').attr("href","{data.data.organization_design}");
=======
                    var msg = data.data;
                    $('.modal-body span').html(msg);
                    $('.modal-body b').html(data.contract);
>>>>>>> a40bd7c37eef93aca4b7ae3126fd10da65b4232b
                } else {
                    //  modal填充
                    $('.modal-title u').html(data.title);
                    $('.modal-body').html(data.datas);
                }
            },
            error: function () {
                alert('AJAX执行失败');
            }
        });
    }

    // 执行ajax删除
    function delAjax(id, obj) {
        $.ajax({
            type: 'delete',
<<<<<<< HEAD
            url: '/Technique/' + id,
=======
            url: '/Engine/' + id,
>>>>>>> a40bd7c37eef93aca4b7ae3126fd10da65b4232b
            dataType: 'json',
            success: function (data) {
                console.log(data);
                if (data.status) {
                    toastr.success(data.info);
                    obj.remove();
                } else {
                    toastr.error(data.info, 'FBI WARNING:');
                }
            },
            error: function () {
                alert('AJAX执行失败');
            }
        });
    }

</script>

{/block}



<<<<<<< HEAD
<!-- $myfile = fopen("文件名", "r") or die("Unable to open file!");
echo fread($myfile, filesize("文件名"));
fclose("文件名") -->
=======

>>>>>>> a40bd7c37eef93aca4b7ae3126fd10da65b4232b
